<html>
<head>
	<title>Customer View/Update</title>
</head>

<body>
	<h1>View or Update Customer</h1>

	
	
	
	<?=form_open('customers/update')?>
		<?='First Name:'.form_input('first_name',$result->first_name).br()?>
		<?='Last Name:'.form_input('last_name',$result->last_name).br()?>
		<?='Middle Initial:'.form_input('middle_initial',$result->middle_initial).br()?>
		
		<?='DOB'.br() ?>
		
		<?=form_input('month',$result->month).' '.form_input('day',$result->day).' '.form_input('year',$result->year).br()?>
		
		
		<!-- Populate the Customer Gender Lookup Field -->
		Gender: <select name="customer_gender_id">
		<?php
			foreach ($genders as $gender) {
				echo "<option value='" . $gender->customer_gender_id . "'";
				if ($gender->customer_gender_id == $result->customer_gender_id)
				{ 
					echo " selected";
				}
				echo ">" . $gender->customer_gender . "</option>";
			}
		?>
		</select> <br />
		
		<!-- Populate the Customer Race Lookup Field -->
		Race: <select name="race_id">
		<?php
			foreach ($races as $race) {
				echo "<option value='" . $race->race_id . "'";
				if ($race->race_id == $result->race_id)
				{
					echo " selected";	
				}
				echo ">" . $race->race_description . "</option>";
			}
		?>
		</select> <br />
		
		<?='Home Address:'.form_input('home_address',$result->home_address).br()?>

		<!-- Populate the City Lookup Field -->
		City: <select name="home_city_id">
		<?php
			foreach ($cities as $city) {
				echo "<option value='" . $city->home_city_id . "'";
				if ($city->home_city_id == $result->home_city_id)
				{
					echo " selected";	
				}
				echo ">" . $city->city . "</option>";
			}
		?>
		</select> <br />
		
		<!-- Populate the State Lookup Field -->
		State: <select name="state_id">
		<?php
			foreach ($states as $state) {
				echo "<option value='" . $state->state_id . "'";
				if ($state->state_id == $result->state_id)
				{
					echo " selected";
				}
				echo ">" . $state->state_name . "</option>";
			}
		?>
		</select> <br />
		
		<?='Home Phone:'.form_input('home_phone',$result->home_phone).br()?>
		<?='Work Name:'.form_input('work_name',$result->work_name).br()?>
		<?='Work Phone:'.form_input('work_phone',$result->work_phone).br()?>
		<?='Photo Id Number:'.form_input('photo_id_number',$result->photo_id_number).br()?>
		<?='Photo Id Type:'.form_input('photo_id_type',$result->photo_id_type).br()?>
		<?='Photo Id State:'.form_input('photo_id_state',$result->photo_id_state).br()?>
		<?='Height:'.form_input('height',$result->height).br()?>
		<?='Weight:'.form_input('weight',$result->weight).br()?>
		
		<!-- Populate the Eye Color Lookup Field -->
		Eye Color: <select name="eye_color_id">
		<?php
			foreach ($eye_colors as $eye_color) {
				echo "<option value='" . $eye_color->eye_color_id . "'";
				if ($eye_color->eye_color_id == $result->eye_color_id)
				{
					echo " selected";
				}
				echo ">" . $eye_color->eye_color . "</option>";
			}
		?>
		</select> <br />
		
		<!-- Populate the Hair Color Lookup Field -->
		Hair Color: <select name="hair_color_id">
		<?php
			foreach ($hair_colors as $hair_color) {
				echo "<option value='" . $hair_color->hair_color_id . "'";
				if ($hair_color->hair_color_id == $result->hair_color_id)
				{
					echo " selected";
				}
				echo ">" . $hair_color->hair_color . "</option>";
			}
		?>
		</select> <br />
		
		<?='Notes:'.form_textarea('customer_note',$result->customer_note).br()?>
		<?=form_hidden('customer_id',$result->customer_id).br()?>
		
		<input type="submit" value="submit" name="submit"><br />
	</form>
	
	
</body>

</html>


